# -*- ecoding: utf-8 -*-
# @ModuleName: demo1
# @Author: wangwei 
# @Time: 2023/10/20 16:33
import re

import javaobj


from common.redis_util import RedisUtil




# resp=RedisUtil().res.get("{BUY_NOW_ORIGIN_DATA_PREFIX}_59")
# print(resp)
# res=javaobj.loads(resp)
# sku_info=res[0]
# # print(res.__dir__())
# print(sku_info.__getattribute__('num'))



# res = RedisUtil().res.get('{BUY_NOW_ORIGIN_DATA_PREFIX}_68456')
#     # 得到的结果是java序列化数据，我们需要将其转成python对象才能解析其中内容
#     # 使用javaobj来加载res
# res_py = javaobj.loads(res)
# sku_info = res_py[0] # 得到列表中第一个产品对象
# print(sku_info.__dir__())
# redis_skuid = sku_info.__getattribute__('skuId')
# redis_num = sku_info.__getattribute__('num')
# print(redis_skuid)
# print(redis_num)















# res_py = javaobj.loads(resp)
# sku_info = res_py[0]
# redis_skuid = sku_info.__getattribute__('skuId')
# redis_num = sku_info.__getattribute__('num')
# print(redis_num)
# print(redis_skuid)



#
# url="${sellerHost}/seller/goods"
#
# get_value=re.findall("\$\{(.*?)\}",url)[0]
# print(get_value)


str='{"params":{"username":"shamo","password":"${{md5(abc123456)}}","captcha":"1512","uuid":"hjsdhdfhhf"}}'
res_data=re.findall('\$\{\{(.*?)\((.*?)\)\}\}',str)
print(res_data)